﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace SwitchHostProject.Model
{
    public class HostGroup
    {
        /// <summary>
        /// 组名
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 类型 0 父节点  1 是叶子节点
        /// </summary>
        public string Type { get; set; } = "0";
        /// <summary>
        /// 是否激活  1 激活  0 非激活
        /// </summary>
        public bool IsActive { get; set; }
        /// <summary>
        /// 子节点数组
        /// </summary>
        public List<HostGroup> Groups { get; set; }

        public HostGroup(string name, string type, List<HostGroup> groups)
        {
            this.Name = name;
            this.Type = type;
            this.Groups = groups;
        }

        public HostGroup(string name, string type, bool isActice, List<HostGroup> groups)
        {
            this.Name = name;
            this.Type = type;
            this.IsActive = isActice;
            this.Groups = groups;
        }

        public HostGroup(string name, string type, bool isActice)
        {
            this.Name = name;
            this.Type = type;
            this.IsActive = isActice;
        }

        public HostGroup(string name)
        {
            this.Name = name;
        }

        public override string? ToString()
        {
            return Name;
        }
    }
}
